package com.ruoyi.rulengine.domain;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 *  规则引擎：规则实体类
 *  https://blog.csdn.net/qq_35485206/article/details/145789107
 */
@Data
public class Rule implements  Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    private String name;

    private String description;

    /**
     * 0: 未启用 1：启用,索引
     */
    private String status;

    /**
     * 逻辑条件，多条件满足规则：AND OR(同时满足，任意满足一个)
     */
    private String logical;


    // 创建时间
    private Date createTime;

    /**
     * 产品标识
     */
    private String productKey;

    /**
     * 设备名称
     */
    private String deviceName;

    /**
     * 通道标识
     */
    private String channelKey = "property";


    /**
     * 设备标识,索引
     */
    private String deviceKey;

    /**
     * 生效时间段，比如：晚上不告警，只有白天告警
     */
    private Date effectiveStartTime;

    private Date effectiveEndTime;

    /**
     * 告警级别，来源数据字典
     */
    private String level;

    /**
     * 条件列表
     */
    private List<RuleCondition> conditions;

    /**
     * 动作列表
     */
    private List<RuleAction> actions;

    /**
     * 执行结果
     */
    private RuleLog ruleLog;


}
